package com.hdmall.business.common.common;

public enum ResponseCode {

    /**
     * 状态码定义
     * 10-19    用户
     * 20-29    产品
     * 30-39    购物车
     * 40-49    订单
     * 50-59    配送
     * 70-79    评论
     * 80-89    部门
     *
     */

    /*0-9 全局*/

    //程序正常
    SUCCESS(0,"SUCCESS"),
    //程序异常
    ERROR(1,"ERROR"),

    ILLEGAL_ARGUMENT(2,"ILLEGAL_ARGUMENT"),

    /*10-19 用户*/
    NEED_LOGIN(10,"NEED_LOGIN"),

    //无该用户
    USER_NOT_FOUND(11, "USER_NOT_FOUND"),

    //用户登录令牌失效
    USER_TOKEN_INVALID(12, "USER_TOKEN_INVALID"),

    //用户密码错误
    USER_PASSWORD_WROING(13, "USER_PASSWORD_WRONG"),

    //手机号已被注册
    USER_POHONE_HAVE_REGISTER(14, "USER_PHONE_HAVE_REGISTER"),

    //更新用户信息失败
    USER_UPDATE_ERROR(15, "USER_UPDATE_ERROR"),

    //完善用户信息失败（图片）
    USER_TEMP_ADD_ERROR(16,"USER_TEMP_ADD_ERROR"),

    //资质获取失败
    USER_DETAIL_GET_ERROR(17, "USER_DETAIL_GET_ERROR"),

    //用户注册失败
    USER_REGISTER_ERROR(18, "USER_REGISTER_ERROR"),

    //未知设备
    USER_AGENT_UNKNOWN(19, "USER_AGENT_UNKNOWN"),

    ORDER_CANCELED(0,"已取消"),
    ORDER_EXAMINE(10,"审核中"),
    ORDER_NO_PAY(30,"未支付"),
    ORDER_NO_SALES_CONT_NO(35,"未签合同"),
    ORDER_NO_SALES_CONT_MISS(36,"合同失效"),
    ORDER_PAID(20,"已付款"),
    ORDER_SHIPPED(40,"已发货"),
    ORDER_ORDER_SUCCESS(50,"交易完成"),
    ORDER_ORDER_CLOSE(60,"订单关闭"),

    /*20-29 产品*/

    //无该产品
    PRODUCT_NOT_FOUND(21, "PRODUCT_NOT_FOUND"),

    //找不到该产品的价格
    PRODUCT_PRICE_NOT_FOUND(22, "PRODUCT_PRICE_NOT_FOUND"),

    //产品已下架
    PRODUCT_DOWN(23, "PRODUCT_DOWN"),

    //产品无库存
    PRODUCT_STOCK_EMPTY(24, "PRODUCT_STOCK_EMPTY"),

    //无需要评价订单
    COMMENT_NOT_EXIST(25, "COMMENT_NOT_EXIST"),

    //已经超过评价时间，默认交易成功的30天后(status=50)
    COMMENT_TIMEOUT(26, "COMMENT_TIMEOUT"),
    //评论创建失败
    COMMENT_CANNOT_CREATE(27, "COMMENT_CANNOT_CREATE"),

    //评论更新失败
    COMMENT_CANNOT_UPDATE(28, "COMMENT_CANNOT_UPDATE"),

    //该商品暂无评价
    COMMENT_CANNOT_FOUND(29, "COMMENT_CANNOT_FOUND"),

    /*30-39 购物车*/


    //购物车为空
    CART_ISEMPTY(31, "CART_ISEMPTY"),

    //购物车内有产品无等级
    CART_NOT_FOUND_GRADE(32, "CART_NOT_FOUND_GRADE"),

    //购物车为空
    CART_WEIGHT_ISEMPTY(32, "CART_WEIGHT_ISEMPTY"),

    //用户未绑定手机
    USER_NEED_TEL(111, "USER_NEED_TEL"),

    //用户手机已经绑定QQ了，无法再次绑定
    USER_TEL_HAVE_BIND_QQ(112, "USER_TEL_HAVE_BIND_QQ"),

    //用户手机已经绑定微信了，无法进行再次绑定
    USER_TEL_HAVE_BIND_WECHAT(113, "USER_TEL_HAVE_BIND_WECHAT"),
    //商户找不到
    SHOP_NOT_FOUND(102, "SHOP_NOT_FOUND"),
    //用户历史插入失败
    USER_BI_ACT_HIS_FOUND(201, "USER_BI_ACT_HIS_FOUND"),

    /*40-49 订单*/

    //订单明细插入有误
    ORDER_ITEM_INSERT_ERROR(41, "ORDER_ITEM_INSERT_ERROR"),

    //订单删除失败
    ORDER_DELETE_ERROR(42, "ORDER_DELETE_ERROR"),
    ORDER_SAMPLE_OUT(46, "ORDER_SAMPLE_OUT"),
//订单明细查询失败
    ORDER_ITEM_SELECT_ERROR(48, "ORDER_ITEM_SELECT_ERROR"),
//订单明细查询没有此订单
    ORDER_ITEM_SELECT_NOT_ERROR(45, "ORDER_ITEM_SELECT_NOT_ERROR"),
    ORDER_ITEM_SELECT_NOT_NULL(45, "ORDER_ITEM_SELECT_NOT_NULL"),
//订单查询失败
    ORDER_SELECT_ERROR(43, "ORDER_SELECT_ERROR"),
    ORDER_UPDATE_ERROR(47, "ORDER_SELECT_UPDATE_ERROR"),
    ORDER_UPDATE_NO_PAY_STATUS_ERROR(49, "订单不是未支付不能取消"),
    //用户此订单
    ORDER_SELECT_NOT_ERROR(44, "ORDER_SELECT_NOT_ERROR"),
    //用户没有订单
    ORDER_SELECT_NULL(46, "ORDER_SELECT_NULL"),
    //部门查询失败
    DEPT_SELECT_NOT_ERROR(84, "DEPT_SELECT_NOT_ERROR"),
    //部门没有数据
    DEPT_CLAUSE_ISNULL_ERROR(85, "DEPT_CLAUSE_ISNULL_ERROR"),
    //合同查询失败
    ORDERSALE_CONT_SELECT_ERROR(88, "ORDERSALE_CONT_SELECT_ERROR"),
    //合同查询NULL
    ORDERSALE_CONT_SELECT_NULL(89, "ORDERSALE_CONT_SELECT_NULL"),
    //合同插入失败
    ORDERSALE_CONT_INSERT_ERROR(87, "ORDERSALE_INSERT_ERROR"),
    DEPT_SELECT_ISNULL_ERROR(83, "DEPT_SELECT_ISNULL_ERROR"),
    ORDERSALE_CONT_DELETE_ERROR(81, "ORDERSALE_CONT_DELETE_ERROR"),
    //部门id查询条款
    DEPT_SELECT_CONT_ISNULL_ERROR(86, "DEPT_SELECT_CONT_ISNULL_ERROR"),
    //订单超时
    ORDER_OUT_TIME(46, "ORDER_OUT_TIME"),
    /*50-59*/
    //找不到货运方式
    FREIGHT_NOT_FOUND(51, "FREIGHT_NOT_FOUND"),

    //暂无该地址的配送价格
    FREIGHT_PRICE_NOT_FOUND(52, "FREIGHT_PRICE_NOT_FOUND"),
    //发票找不到
    INVOICE_NOT_FOUND(91, "INVOICE_NOT_FOUND"),

    //找不到字典表内容
    DICTION_NOT_FOUND(61, "DICTION_NOT_FOUND"),

    //评论已经存在
    COMMENT_HAVE_EXIST(71, "COMMENT_HAVE_EXIST"),

    COMMENT_PRODUCT_NOT_FOUND(72, "COMMENT_PRODUCT_NOT_FOUND"),

    //找不到公司
    DEPT_NOT_FOUND(88, "DEPT_NOT_FOUND"),

    //该公司超过联系人限制
    DEPT_OVER_LINK(89, "DEPT_OVER_LINK"),

    //无匹配办事处
    DEALER_NOT_FOUND(90, "DEALER_NOT_FOUND"),
    //RABBIT操作失误
    RABBIT_EXCHANGE_ERROR(110, "RABBIT_EXCHANGE_ERROR"),

    PAGE_IS_ZERO(140, "PAGE_IS_ZERO"),
    WEIGHT_IS_ZERO(160, "WEIGHT_IS_ZERO"),
    GRRADE_IS_NULL(161, "GRRADE_IS_NULL"),
    UNPAY_PAYMENT_IS_CLEAR(170, "UNPAY_PAYMENT_IS_CLEAR"),
    //消息类型不能空
    MSG_ISEMPTY(120, "MSG_ISEMPTY"),
    //消息类型不能空
    MSG_SENDTYPE_ISEMPTY(122, "MSG_SENDTYPE_ISEMPTY"),
    //支付价格是0
    PAY_ORDER_PAYMENT_ZERO(150, "PAY_ORDER_PAYMENT_ZERO"),
    //支付凭证插入失败
    PAYMENTVOUCHER_INSERT_ERROR(180, "您的订单与身份不匹配"),
    PAYMENTVOUCHER_DEPOSIT_REPEAT(181, "已经交付定金不能重新支付"),
    //SHIPPING_CHECK_NOT_FOUND
    SHIPPING_CHECK_NOT_FOUND(130, "SHIPPING_CHECK_NOT_FOUND"),
    //SHIPPING_UPDATE_ERROR
    SHIPPING_UPDATE_ERROR(131, "SHIPPING_UPDATE_ERROR"),
    SHIPPING_NOT_FOUND(132, "SHIPPING_NOT_FOUND")
    ;



    private final int code;
    private final String desc;


    ResponseCode(int code,String desc){
        this.code = code;
        this.desc = desc;
    }

    public int getCode(){
        return code;
    }
    public String getDesc(){
        return desc;
    }

}
